<?php
class Agitum_Orm_Attribute
{
    public static function factory(Agitum_Orm_Attirbute_Type $type, $opt = array() ) 
    {
        $attr = null;
        switch($type)
        {
            case Agitum_Orm_Attirbute_Type::UUID:
                $attr = new Agitum_Orm_Attirbute_UUID($opt);
                break;
            case Agitum_Orm_Attirbute_Type::Boolean: 
                $attr = new Agitum_Orm_Attribute_Boolean($opt); 
                break;
            case Agitum_Orm_Attirbute_Type::Integer:
                $attr = new Agitum_Orm_Attribute_Integer($opt); 
                break;
            case Agitum_Orm_Attirbute_Type::Double: 
                $attr = new Agitum_Orm_Attribute_Double($opt);
                break;
            case Agitum_Orm_Attirbute_Type::String: 
                $attr = new Agitum_Orm_Attribute_String($opt);
                break;
            case Agitum_Orm_Attirbute_Type::Text: 
                $attr = new Agitum_Orm_Attribute_Text($opt);
                break;
            case Agitum_Orm_Attirbute_Type::Html: 
                $attr = new Agitum_Orm_Attribute_Html($opt);
                break;
            case Agitum_Orm_Attirbute_Type::Date: 
                $attr = new Agitum_Orm_Attribute_Date($opt);
                break;
            case Agitum_Orm_Attirbute_Type::Time: 
                $attr = new Agitum_Orm_Attribute_Time($opt);
                break;
            case Agitum_Orm_Attirbute_Type::Datetime: 
                $attr = new Agitum_Orm_Attribute_Datetime($opt);
                break; 
            case Agitum_Orm_Attirbute_Type::Timestamp: 
                $attr = new Agitum_Orm_Attribute_Timestamp($opt);
                break;
            case Agitum_Orm_Attirbute_Type::Email:
                $attr = new Agitum_Orm_Attribute_Email($opt);
                break;
            case Agitum_Orm_Attirbute_Type::Password: 
                $attr = new Agitum_Orm_Attribute_Password($opt);
                break;
            case Agitum_Orm_Attirbute_Type::File: 
                $attr = new Agitum_Orm_Attribute_File($opt);
                break;
            case Agitum_Orm_Attirbute_Type::Image: 
                $attr = new Agitum_Orm_Attribute_Image($opt);
                break;
            case Agitum_Orm_Attirbute_Type::Object: 
                $attr = new Agitum_Orm_Attribute_Object($opt);
                break;
            case Agitum_Orm_Attirbute_Type::LTree: 
                $attr = new Agitum_Orm_Attribute_LTree($opt);
                break;
            case Agitum_Orm_Attirbute_Type::HStore: 
                $attr = new Agitum_Orm_Attribute_Hstore($opt);
                break;
            case Agitum_Orm_Attirbute_Type::Enum: 
                $attr = new Agitum_Orm_Attribute_Enum($opt);
                break;
            default:
                throw new Exception('No class defined for type: '.$type );
        }
    }
}